<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>独立作用域</title>
  </head>
  <body>
    <script type="text/javascript">
      console.log(a); // undefined
      c(); // TypeError: c is not a function
      {
        c(); // 10
        var a = 10;
        let b = 10;
        function c() {
          console.log(b);
        }
      }
      console.log(a); // 10
      console.log(b); // ReferenceError: b is not defined
      console.log(c); // f () {}
    </script>
  </body>
</html>
